<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/1
  Time: 9:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-3.7.1.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/_axios.js"></script>
    <script>
        $(function () {
            $axios.doGet('actor').then(res=>{
                $.each(res, function (i, a) {
                    var content=''
                    $.each(a.films, function (i, e) {
                        content+=`<li>\${e.title}</li>`
                    });


                    $("tbody").append(`
                    <tr>
                       <td>\${a.actorId}</td>
                       <td>\${a.firstName}</td>
                       <td>\${a.lastName}</td>
                       <td>\${a.lastUpdate}</td>
                       <td>
                          <ul>
                              \${content}
                          </ul>
                       </td>
                   </tr>
                    `)
                });
            })
        });
    </script>
</head>
<body>
<table border="1" cellspacing="0">
    <thead>
    <tr>
        <th>actor_id</th>
        <th>first_name</th>
        <th>last_name</th>
        <th>last_update</th>
        <th>film</th>
    </tr>
    </thead>
   <tbody>

   </tbody>

</table>
</body>
</html>
